.TH eddie 1
.SH NAME
eddie \- run haskell filters from the command line
.SH SYNOPSYS
.B eddie
.RI [ options ]
.RI [ expr ]
.I file ...
.SH DESCRIPTION
.B eddie
evalutes the provided
.I expression
on either the contents of the
.I file
arguments concatenated together,
or standard input if no file arguments are present.
.PP
The
.BR \-\-line ,
.B \-\-file
and
.B \-\-list
options can be used to cause
.I expression
to be used to process each line, each file,
or a list of files or lines respectively.
.PP
The prelude, Data.List and Data.Char modules are available for building
expressions. Other modules may be added with the
.B \-\-Modules
and
.B \-\-modules
options.
.SH OPTIONS
.IP \-\-expr
The
.B \-\-expr
.I expr
(short form
.B \-e
.IR expr )
option concatenates it's value to the
haskell expression being evaluated with a newline separator.
Multiple occurrences can be used to build up a
multi-line expression.
.RS
.PP
If no
.B \-e
.I expr
option is present, the first non-flag argument will be used for
the haskell expression.
.RE 1
.IP \-\-line
The
.B \-\-line
(short form
.BR \-l )
option causes
.B eddie
to process input line at a time. The
.I expr
will be run on each line and the results concatenated together
(using unlines).
.RS
.PP
The command
.RS
.PP
.B eddie \-l
.I expr file ...
.RE
.PP
is equivalent to the command
.RS
.PP
.B eddie
"unlines . map
.IR expr  .
lines"
.I file ...
.
.RE 1
.IP \-\-file
The
.B \-\-file
(short form
.BR \-f )
causes each file to be processed individually.
.RS
.PP
Note that the
.B \-l
and
.B \-f
options cannot be used together.
.RE 1
.IP \-\-list
The
.B \-\-list
(short form
.BR \-L )
option causes
.B eddie
to pass the expression a list of lines or files.
This requires one of the
.B \-l
or
.B \-f
options be used.
.RS
.PP
The command
.RS
.PP
.B eddie \-lL
.I expr file ...
.RE
.PP
is equivalent to the command
.RS
.PP
.B eddie
"unlines .
.I expr
\&. lines"
.I file ...
.
.RE 1
.IP \-\-binary
The
.B \-\-binary
(short form
.BR \-b )
option switches the output mode to binary.
It also disables the maybe newline processing.
Normally 
.B eddie
will output a final newline if the last character
of the input is not a newline to place the prompt properly.
If the
.B \-b
option is used, the final newline will not be output.
.RE 1
.IP \-\-modules
The
.B \-\-modules
.I name
(short form
.B \-m 
.IR name )
option is used to import module
.I name
into haskell before evaluating the expression.
.IP \-\-Modules
The
.B \-\-Modules
.I name,as
(short form
.B \-M
.IR name,as )
option imports the
.I name
module using a qualified import with an as clause,
with 
.I as
being the value for the as clause.
.SH DIAGNOSTICS
If the command runs with no problems, eddie will exit with a status of 0.
If there are problems with the options, such that the expression is never
evaluated, then eddie will exit with a status of 1.
If haskell returns an error - probably a compilation problem - then
eddie will exit with the status of 2.
.SH SEE ALSO
The wiki at <http://code.google.com/p/eddie/w/list> for examples.
.SH BUGS
See the issues list at <http://code.google.com/p/eddie/issues/list>.
.SH AUTHOR
Mike Meyer (mwm@mired.org)
